home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2006 April / PCnet 2006-06.4.iso / shareware / nmsetup.exe / WebServer / web / feed.php < prev    next >
Encoding:
PHP Script  |  2006-05-01  |  22.6 KB  |  464 lines

  1. <?php
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // <!--Copyright (c) 2005 Pure Networks Inc.  All rights reserved.-->
  4. ////////////////////////////////////////////////////////////////////////////////
  5. //
  6. // Build: 3.0.6121.0 (Stable)
  7. // $Revision: #2 $
  8. //
  9.  
  10. $sNavLocation = "feed";
  11. require "_folderutils.php";
  12. require "_session_common.php";
  13. $iPort  = ":8008";
  14.  
  15. ////////////////////////////////////////////////////
  16. // do we need to limit the number of returned items?
  17. ////////////////////////////////////////////////////
  18. // check the _config file, if no value, set backup default here
  19. if (!isset($iFeedCountLimit))
  20. {
  21.     $iFeedCountLimit = 25; 
  22. }
  23. // should we over-ride the default with a QS value?
  24. if (isset($_GET['itemlimit']))
  25. {
  26.     $iFeedCountLimit = $_GET['itemlimit']; 
  27. }
  28. // now let's cap out the given limit if we have a max value in the _config file
  29. if (isset($iFeedCountMax) && $iFeedCountLimit > $iFeedCountMax)
  30. {
  31.     $iFeedCountLimit = $iFeedCountMax;
  32. }
  33.  
  34. unset($_SESSION['currentPhotos']);
  35. $iPictureCount  = 0;
  36. $arFiles        = "";
  37. $cFiles         = 0;
  38. switch($_GET['feed_type'])
  39. {
  40.     case "sharelist":
  41.     case "whatsnew":
  42.     case "screensaver":
  43.     case "shares":
  44.         $sFeedtype = $_GET['feed_type'];
  45.         break;
  46.     default:
  47.         $sFeedtype = "whatsnew";
  48. }
  49.  
  50. switch($_GET['sort'])
  51. {
  52.     case "none":
  53.         $sSortType = "none";
  54.         break;
  55.     default:
  56.         $sSortType = "date";
  57. }
  58.  
  59. $bRandom = false;
  60. switch($_GET['random'])
  61. {
  62.     case "yes":
  63.         $bRandom = true;
  64.         break;
  65.     default:
  66.         $bRandom = false;
  67. }
  68.  
  69. switch($sFeedtype)
  70. {
  71.     case "shares":
  72.         ///////////////////////////////////////////////////
  73.         // let's try to get the network places here, because if we have none, we
  74.         // don't want to show certain UI (such as the sort by links)
  75.         ///////////////////////////////////////////////////
  76.         try
  77.         {
  78.             $nmSharedPlaces = $nmNetworkLib->OpenAllShares();
  79.             ///////////////////////////////////////////////////
  80.             // let's remove all but the public shares
  81.             ///////////////////////////////////////////////////
  82.             $nmSharedPlaces = removeSharesFromArray($nmSharedPlaces, 1);
  83.             $nmSharedPlaces = removeSharesFromArray($nmSharedPlaces, 2);
  84.         }
  85.         catch(Exception $ex)
  86.         {
  87.             $nmSharedPlaces = null;
  88.         }
  89.         
  90.         ///////////////////////////////////////////////////
  91.         // We now have the correct shares, let's get their info
  92.         ///////////////////////////////////////////////////
  93.         if (count($nmSharedPlaces) > 0 )
  94.         {
  95.             // We have the shared places array, but they are in computer/folder non-alpha order.
  96.             // we need to be able to sort by computer or folder, so to do this
  97.             // we have to take this array and create a multi-column array to be
  98.             // able to sort on either, as neither are sorted properly in the current returned list.
  99.             //
  100.             // For some reason, PHP is not honoring case insensitivity in the SORT_ASC, so we need
  101.             // to create a 100% lower case array which we will use for sorting, and use the
  102.             // array_multisort below to sort all arrays together based on the right ASC case insensitive
  103.             // order of either folders alone or computers and then folders
  104.             
  105.         
  106.             $j=0;
  107.             $arShareNames = null;
  108.             $arShareLocations = null;
  109.             $arShareNamesCase = null;
  110.             $arShareLocationsCase = null;
  111.             foreach ($nmSharedPlaces as $share)
  112.             {
  113.                 try
  114.                 {
  115.                     $sShareId            = $share->Id;
  116.                     $sShareUnc           = $share->Unc;
  117.                     $arShareNames[$j][0] = htmlspecialchars($share->ShareName);
  118.                     $arShareNames[$j][1] = $sShareId;
  119.                     $arShareNames[$j][2] = $sShareUnc;
  120.                     $arShareNames[$j][3] = $share->IsOnline;
  121.                     $arShareNames[$j][4] = $share->CountFiles;
  122.                     $arShareNames[$j][5] = $share->CountFolders;
  123.                     $arShareNames[$j][6] = $share->AccessLevel;
  124.                     $arShareNames[$j][7] = htmlspecialchars("/folderview/" . $sShareId . "/" . urlEncodeString($sShareUnc));
  125.         
  126.                     $arShareLocations[$j] = $share->Location;
  127.         
  128.                     $arShareDescriptions[$j][0] = htmlspecialchars($share->Description);
  129.                     $arShareDescriptions[$j][1] = htmlspecialchars($share->FriendlyName);
  130.                     $arShareDescriptions[$j][2] = htmlspecialchars($share->ShareName);
  131.                     $arShareDescriptions[$j][3] = $share->Thumbnail;
  132.         
  133.                     $arShareNamesCase[$j] = strtolower($arShareNames[$j][0]);
  134.                     $arShareLocationsCase[$j] = strtolower($arShareLocations[$j]);
  135.                     $arShareDescriptionsCase[$j] = strtolower($arShareDescriptions[$j][0]);
  136.                     $arShareLevelsCase[$j] = $arShareNames[$j][6];
  137.                     $j++;
  138.                 }
  139.                 catch(Exception $ex)
  140.                 {
  141.                     log_activity("Collecting share properties", "exception", $ex->getMessage());
  142.                 }
  143.             }
  144.         }
  145.         break;
  146.     case "sharelist":
  147.         ///////////////////////////////////////////////////
  148.         // Make sure that we have a valid sharelist passed in.
  149.         ///////////////////////////////////////////////////
  150.         if (!isset($_GET['sharelist']) or $_GET['sharelist'] == "")
  151.         {
  152.             log_activity("QS check", "failure", return_error_text(200, "", $arErrors));
  153.             gotoAbs('/error/200&return=/folders/');
  154.             exit();
  155.         }
  156.         else
  157.         {
  158.             $sShareList = $_GET['sharelist'];
  159.             $arShares = split(";", $sShareList);
  160.         }
  161.         foreach ($arShares as $share)
  162.         {
  163.             ///////////////////////////////////////////////////
  164.             // Let's try to see if we can open the share
  165.             ///////////////////////////////////////////////////
  166.             try
  167.             {
  168.                 $nmSharedPlace = $nmNetworkLib->OpenShare($share);
  169.                 if ($arShareDescriptions[$i][1] != "")
  170.                 {
  171.                     $sFeedTitle = htmlspecialchars($nmSharedPlace->FriendlyName);
  172.                 }
  173.                 else
  174.                 {
  175.                     $sFeedTitle = htmlspecialchars($nmSharedPlace->ShareName);
  176.                 }
  177.                 try
  178.                 {
  179.                     $sAccessLevel = $nmSharedPlace->AccessLevel;
  180.                     if ($sAccessLevel <= 0)
  181.                     {
  182.                         // TODO: throw exception
  183.                     }
  184.                 }
  185.                 catch(Exception $ex)
  186.                 {
  187.                     log_activity("Attempting nmSharedPlace->AccessLevel", "exception", $ex->getMessage());
  188.                     gotoAbs('/error/305/return');
  189.                     exit();
  190.                 }
  191.                 ///////////////////////////////////////////////////
  192.                 // let's open up the share(s) on the FS & feed our arrays
  193.                 ///////////////////////////////////////////////////
  194.                 addFilesAndFolders($nmSharedPlace->Unc, $nmSharedPlace, $arFiles, $cFiles);
  195.             }
  196.             catch(Exception $ex)
  197.             {
  198.                 $nmSharedPlaces = null;
  199.                 log_activity("Attempting nmNetworkLib->OpenShare()", "exception", $ex->getMessage());
  200.                 // TODO: ERROR RSS FEED
  201.             }
  202.         }
  203.         break;
  204.     case "whatsnew":
  205.     case "screensaver":
  206.         $sFeedTitle = $sNetworkName;
  207.         ///////////////////////////////////////////////////
  208.         // let's get the network places 
  209.         ///////////////////////////////////////////////////
  210.         try
  211.         {
  212.             $nmSharedPlaces = $nmNetworkLib->OpenAllShares();
  213.         }
  214.         catch(Exception $ex)
  215.         {
  216.             $nmSharedPlaces = null;
  217.             log_activity("Attempting nmNetworkLib->OpenAllShares()", "exception", $ex->getMessage());
  218.             // TODO: ERROR RSS FEED
  219.         }
  220.         
  221.         ///////////////////////////////////////////////////
  222.         // let's remove all but the public shares
  223.         ///////////////////////////////////////////////////
  224.         $nmSharedPlaces = removeSharesFromArray($nmSharedPlaces, 1);
  225.         $nmSharedPlaces = removeSharesFromArray($nmSharedPlaces, 2);
  226.         ///////////////////////////////////////////////////
  227.         // let's open up the share(s) on the FS & feed our arrays
  228.         ///////////////////////////////////////////////////
  229.         foreach ($nmSharedPlaces as $share)
  230.         {
  231.             addFilesAndFolders($share->Unc, $share, $arFiles, $cFiles);
  232.         }
  233.         break;
  234.     default:
  235.         // TODO: what here??
  236. }
  237.  
  238. ///////////////////////////////////////////////////
  239. // Init hte variables we need for teh feed's header
  240. ///////////////////////////////////////////////////
  241. try
  242. {
  243.     $sNetworkName   = $nmNetworkLib->NetworkName;
  244.     $sWanIp         = $nmRaManager->HomeUrl;
  245.     $sWanIp         = str_replace(".networkmagic.com",".home.networkmagic.com",$sWanIp);
  246.     $sWanIp         = str_replace(".net2go.com",".home.net2go.com",$sWanIp);
  247.     $sLanIp         = "http://" . $nmRaManager->LanIP;
  248. }
  249. catch (exception $ex)
  250. {
  251.     //TODO CATCH LOGIC HERE
  252. }
  253.  
  254. switch ($_GET["IP"])
  255. {
  256.     case "LAN":
  257.         $sIPToUse = $sLanIp;
  258.         break;
  259.     case "WAN":
  260.         $sIPToUse = $sWanIp;
  261.         break;
  262.     default:
  263.         $sIPToUse = $sWanIp;
  264. }
  265.  
  266. $arFiles     = $_SESSION['currentPhotos'];
  267.  
  268. if ($bRandom)
  269. {
  270.     shuffle($arFiles);
  271. }
  272. else
  273. {
  274.     if ($sSortType == "date" && $sFeedtype != "shares")
  275.     {
  276.         $arFileTimes = $_SESSION['currentPhotosTimes'];
  277.         array_multisort($arFileTimes, SORT_DESC, SORT_STRING, $arFiles);
  278.     }
  279. }
  280.  
  281. $iCounter = 0;
  282.  
  283. switch ($_GET["format"])
  284. {
  285.     case "html":
  286.         foreach ($arFiles as $file)
  287.         {
  288.             $thumbnaillink = "/thumbnail/" . urlEncodeString($file[0]) . "/" . urlEncodeString($file[1]) . "/" . urlEncodeString($file[3]);
  289.             $viewlink      = "/fileview/" . urlEncodeString($file[0]) . "/" . urlEncodeString($file[2]) . "/" . urlEncodeString($file[3]);
  290.             $sFileNameForDisplay = $files[3];
  291.         ?>
  292.             <div class="Thumbnailphoto">
  293.                 <div id="TN<?php echo ($iCounter); ?>" class="ThumbnailImage" title="View details for file '<?php echo ($sFileNameForDisplay); ?>'.">
  294.                         <a class=link href="<?php echo ($viewlink);?>" title="View details for file '<?php echo($sFilenameForDisplay);?>'.">
  295.                         <img src="<?php echo $thumbnaillink;?>" border="0" alt="<?php echo ($sFilenameForDisplay);?>"/></a>
  296.                 </div>
  297.             </div>
  298.         <?php
  299.             $iCounter++;
  300.             if ($iCounter >= $iFeedCountLimit)
  301.             {
  302.                 // we've hit the configured limit on new files, let's break out...
  303.                 break;
  304.             }
  305.         }
  306.         break;
  307.     case "xml":
  308.     default:
  309.         ///////////////////////////////////////////////////
  310.         // let's create the feed now
  311.         ///////////////////////////////////////////////////
  312.         header("Content-Type: text/xml");
  313.         ?>
  314. <?php echo '<?xml version="1.0" encoding="utf-8"?'.'>'; ?>
  315.         <!-- generator="Pure Networks - Net2Go 3.0.6121.0 (Stable)" -->
  316.         <rss version="2.0" 
  317.             xmlns:content="http://purl.org/rss/1.0/modules/content/"
  318.             xmlns:Net2Go="http://www.net2go.com/ns/Net2Go#"
  319.             xmlns:media="http://search.yahoo.com/mrss">
  320.         <channel>
  321.             <title><![CDATA[<?php echo ($sFeedTitle); ?>]]></title>
  322.             <link><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>]]></link> <?php //TODO BETTER DOMAIN NAME HRE FOR IN/OUT OF NETWORK USE?? ?>
  323.             <description><![CDATA[<?php echo ($sNetworkName); ?>]]></description>
  324.             <language><![CDATA[en]]></language>
  325.             <copyright><![CDATA[Copyright 2005]]></copyright>
  326.             <pubDate><![CDATA[<?php echo (date("D, d M Y H:i:s O")); ?>]]></pubDate>
  327.             <generator><![CDATA[http://www.net2go.com/]]></generator>
  328.         <?php
  329.                 switch($sFeedtype)
  330.                 {
  331.                 case "shares":
  332.                     for ($i=0; $i < count($arShareNames); $i++)
  333.                     {
  334.                         $imgLocation    = $arShareDescriptions[$i][3];
  335.                         $iFileNamePos   = strpos($imgLocation, strrchr($imgLocation, "\\"));
  336.                         $sFile          = substr($imgLocation, $iFileNamePos+1);
  337.                         $sPathNoFile    = substr($imgLocation, 0, (strlen($imgLocation) - strlen($sFile) - 1));
  338.                         // We want a generic folder icon for shares without pics (or with a failed pic...)
  339.                         if (!file_exists($imgLocation) || !isValidString($imgLocation))
  340.                         {
  341.                             $sharethumbnaillink    = "/styles/" . $sStyleFamily . "/" . $sStyleName . "/place.48.gif";
  342.                             $imgMode = "Generic";
  343.                         }
  344.                         else
  345.                         {
  346.                             $sharethumbnaillink = "/sharethumbnail/" . $arShareNames[$i][1] . "/" . urlEncodeString(str_replace("\\\\","\\",$sPathNoFile)) . "/" . urlEncodeString($sFile);
  347.                         }
  348. ?>
  349.                         <item>
  350.                             <title><![CDATA[<?php echo ($arShareDescriptions[$i][2]); ?>]]></title>
  351.                             <link><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?><?php echo ($arShareNames[$i][7]); ?>]]></link>
  352.                             <Net2Go:share>
  353.                                 <id><![CDATA[<?php echo ($arShareNames[$i][1]); ?>]]></id>
  354.                                 <unc><![CDATA[<?php echo ($arShareNames[$i][2]); ?>]]></unc>
  355.                                 <status><![CDATA[<?php echo ($arShareNames[$i][3]); ?>]]></status>
  356.                                 <countfiles><![CDATA[<?php echo ($arShareNames[$i][4]); ?>]]></countfiles>
  357.                                 <countfolders><![CDATA[<?php echo ($arShareNames[$i][5]); ?>]]></countfolders>
  358.                                 <location><![CDATA[<?php echo ($arShareLocations[$i]); ?>]]></location>
  359.                                 <thumbnail><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?><?php echo ($sharethumbnaillink); ?>]]></thumbnail>
  360.                                 <name><![CDATA[<?php echo ($arShareDescriptions[$i][2]); ?>]]></name>
  361.                                 <friendlyname><![CDATA[<?php echo ($arShareDescriptions[$i][1]); ?>]]></friendlyname>
  362.                                 <description><![CDATA[<?php echo ($arShareDescriptions[$i][0]); ?>]]></description>
  363.                             </Net2Go:share>
  364.                             <pubDate><![CDATA[<?php echo(date ("D, d M Y H:i:s O")); ?>]]></pubDate>
  365.                             <lastBuildDate><![CDATA[<?php echo(date ("D, d M Y H:i:s O")); ?>]]></lastBuildDate>
  366.                             <author><![CDATA[webmaster@net2go.com]]></author>
  367.                             <guid isPermaLink="false"><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/<?php echo ($arShareNames[$i][7]); ?>]]></guid>
  368.                             <description><![CDATA[<?php echo ($arShareDescriptions[$i][2]); ?>]]></description>
  369.                             <content:encoded><![CDATA[<?php echo ($arShareDescriptions[$i][2]); ?><br/><a href="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?><?php echo ($arShareNames[$i][7]); ?>"><img border="0" src="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?><?php echo ($sharethumbnaillink); ?>"/></a>]]></content:encoded>
  370.                         </item>
  371. <?php
  372.                     }
  373.                     break;
  374.                 default:
  375.                     foreach ($arFiles as $file)
  376.                     {
  377.                         $fileExtension = strtolower(strrchr($file[3], "."));
  378.                         switch ($fileExtension)
  379.                         {
  380.                             case ".jpg":
  381.                             case ".jpe":
  382.                             case ".jpeg":
  383.                             case ".jfif":
  384.                             case ".gif":
  385.                             case ".png":
  386.                                 $arImageInfo = getimagesize($file[2]);
  387.             ?>
  388.                                 <item>
  389.                                     <title><![CDATA[<?php echo (urlEncodeString($file[3])); ?>]]></title>
  390.                                     <media:title><![CDATA[<?php echo (urlEncodeString($file[3])); ?>]]></media:title>
  391.                                     <link><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileview/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[2]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></link>
  392.                                     <pubDate><![CDATA[<?php echo(date ("D, d M Y H:i:s O", filectime($file[2]))); ?>]]></pubDate>
  393.                                     <author><![CDATA[webmaster@net2go.com]]></author>
  394.                                     <guid isPermaLink="false"><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileview/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[2]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></guid>
  395.                                     <media:content url="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileopen/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>" type="<?php echo (image_type_to_mime_type($arImageInfo[2])); ?>" <?php echo ($arImageInfo[3]); ?>/>
  396.                                     <description><![CDATA[<?php echo (urlEncodeString($file[3])); ?>]]></description>
  397.                                     <Net2Go:image>
  398.                                         <fullsize><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileopen/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></fullsize>
  399.                                         <detailsview><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/detailsview/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></detailsview>
  400.                                         <slideimage><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/slideimage/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></slideimage>
  401.                                         <thumbnail><![CDATA[<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/thumbnail/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>]]></thumbnail>
  402.                                         <share_guid><![CDATA[<?php echo (urlEncodeString($file[0])); ?>]]></share_guid>
  403.                                     </Net2Go:image>
  404.                                     <media:thumbnail url="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/thumbnail/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>" height="<?php echo ($iThumbnailHeight);?>" width="<?php echo ($iThumbnailWidth);?>"/>
  405.                                     <media:text type="html"><![CDATA[<p><?php echo (urlEncodeString($file[3])); ?><br/><a href="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileview/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[2]));?>/<?php echo (urlEncodeString($file[3])); ?>"><img border="0" src="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/thumbnail/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>"/></a></p>]]></media:text>
  406.                                     <content:encoded><![CDATA[<p><?php echo (urlEncodeString($file[3])); ?><br/><a href="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/fileview/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[2]));?>/<?php echo (urlEncodeString($file[3])); ?>"><img border="0" src="<?php echo ($sIPToUse); ?><?php echo ($iPort); ?>/thumbnail/<?php echo (urlEncodeString($file[0])); ?>/<?php echo (urlEncodeString($file[1]));?>/<?php echo (urlEncodeString($file[3])); ?>"/></a></p>]]></content:encoded>
  407.                                 </item>
  408.             <?php
  409.                                 $iCounter++;
  410.                                 break;
  411.                         }
  412.                         if (($iCounter >= $iFeedCountLimit))
  413.                         {
  414.                             // we've hit the configured limit on new files, let's break out...
  415.                             //TODO: only for what's new...
  416.                             break;
  417.                         }
  418.                     }
  419.                 }
  420.         ?>
  421.         </channel>
  422.         </rss>
  423. <?php
  424.         break;
  425. }
  426.  
  427. function addFilesAndFolders($sPath, $share, $arFiles, $cFiles)
  428. {
  429.     global $cFiles, $arFiles, $arFileTimes;
  430.     if ($share->IsOnline)
  431.     {
  432.         $handle = opendir($sPath);
  433.         while (false !== ($file = readdir($handle)))
  434.         {
  435.             $sFullPath = $sPath . "\\" . $file;
  436.             // we've got a directory, make sure it's not the . or .. folder and stuff it's info in the folder array
  437.             if ($share->IsDisplayableItem($sFullPath) && is_dir($sFullPath) && ($file != ".") && ($file != ".."))
  438.             {
  439.                 // Got a directory, let's recurse through it
  440.                 addFilesAndFolders($sFullPath, $share, $arFiles, $cFiles);
  441.             }
  442.             // we've got a file, let's grab the extension and stuff it's info in either the photo or the non photo array
  443.             if (is_file($sFullPath) && is_readable($sFullPath) && $share->IsDisplayableItem($sFullPath))
  444.             {
  445.                 $arFiles[$cFiles][0] = $share->Id;
  446.                 $arFiles[$cFiles][1] = $sPath;
  447.                 $arFiles[$cFiles][2] = $sFullPath;
  448.                 $arFiles[$cFiles][3] = $file;
  449.                 $arFiles[$cFiles][4] = filectime($sFullPath);
  450.                 $arFileTimes[$cFiles] = filectime($sFullPath);
  451.                 $cFiles++; // increment the array position counter
  452.             }
  453.         }
  454.         $_SESSION['currentPhotos']      = $arFiles;
  455.         $_SESSION['currentPhotosTimes'] = $arFileTimes;
  456.     }
  457. }
  458.  
  459. function printErrorFeed($iErrorCode)
  460. {
  461.     // TODO create feed here...
  462.     exit();
  463. }
  464. ?>